|
|
Shay <sah### [at] simcopartscom> wrote:
> How can I calculate the normal of a vertex which lies on the side of a
> triangle. but not at the corner?
> ___________y
> |\ /|
> | \ B / |
> | \ / |
> | \ / |
> | C X |
> | / |
> | / A |
> | / |
> |/________|
z
> How would I calculate the normal at point X given the normals of triangles
> A, B, & C?
If B and C both share a vertex with A (marked as vertices 'y' and 'z' in
the picture), and X lies on the side of A, then B and C lie on the same plane
and could be replaced with one triangle.
If replacing them is not an option, then the answer is that the normal
at X is the interpolation of the normal vectors at 'y' and 'z', that is,
the weigthed average of the normals, where the weighting factor is the
distance of X from y or z.
This is how POV-Ray interpolates the normals of a smooth triangle (or at
least I suppose so), so you should get smooth lighting in this edge. (If
POV-Ray interpolates in some other way, you'll get a sharp edge in the
lighting.)
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
|